package lanqiao;

public class l2015_02 {
    public static int ans;

    public static void main(String[] args){
        for (int i=1;i<60;i++){
            int a=i*i*i;
            int sum = sum(a);
            if (i==sum){
                System.out.println(i+" "+a);
                ans++;
            }
        }
        System.out.println(ans);
    }

    public static int sum(int a){
        String s = String.valueOf(a);
        int sum=0;
        for (int i = 0;i<s.length();i++){
            sum+=s.charAt(i)-'0';
        }
        return sum;
    }
}
